<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('修改员工')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-serviceItem-edit" th:object="${employee}">
        <input  name="id" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name"  th:field="*{name}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">邮箱：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="email"  th:field="*{email}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">年龄：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="age" th:field="*{age}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">入职时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text"  th:value="${#dates.format(employee.hiredate,'yyyy-MM-dd')}" required readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所在部门：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b"  th:with="type=${@dept.list()}"  th:field="*{deptId}">
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:text="${dict.name}"
                            th:value="${dict.id}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否是管理员：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_user_admin')}">
                    <input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}" th:checked="${dict.isDefault}" th:field="*{admin}">
                    <label th:for="${dict.id}" th:text="${dict.label}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "/business/employee";
    $("#form-serviceItem-edit").validate({
        focusCleanup: true
    });



    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-serviceItem-edit').serialize());
        }
    }
</script>
</body>
</html>
